// program to illustrate constructors and constructor overloading

#include<iostream.h>
#include<conio.h>

class cylinder
{
public:
int r,h;
cylinder()
{
r=45;
h=32;
cout<<"\nr="<<r<<"\nh";

}

cylinder(int x,int y)
{
r=x;
h=y;
cout<<"\nr=h="<<x;

}

cylinder(int x)
{
r=h=x;
cout<<"\nr=h="<<x;
}

cylinder(cylinder&p)
{
r=p.r;
h=p.h;
cout<<"\nr"<<r<<"\th"<<h;

}
};

void main()
{
clrscr();
cylinder c1;
cylinder c2(3,4);
cylinder c3(2);
cylinder c4(c1);
getch();

}

/*
output:
r=45  h=32
r=3    h=4
r=h=2
r=45  h=32
*/
